<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>swiper</title>
    <link rel="stylesheet" href="./modelCss/swiper.min.css">
    <script src="./js/jquery-3.4.1.min.js"></script>
    <script src="./js/swiper.min.js"></script>
    <style>
        .swiper-container {
            width: 600px;
            height: 600px;
        }
        .swiper-slide img{
            width: 70%;
            margin: 0 auto;
            display: block;
        }
    </style>
</head>

<body>
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <div class="swiper-slide">
                <img src="./images/1.jpg" alt="">
            </div>
            <div class="swiper-slide">
                <img src="./images/2.jpg" alt="">
            </div>
            <div class="swiper-slide">
                <img src="./images/3.jpg" alt="">
            </div>
        </div>
        <!-- 如果需要分页器 -->
        <div class="swiper-pagination"></div>

        <!-- 如果需要导航按钮 -->
        <div class="swiper-button-prev"></div>
        <div class="swiper-button-next"></div>

        <!-- 如果需要滚动条 -->
        <div class="swiper-scrollbar"></div>
    </div>
    <!-- 导航等组件可以放在container之外 -->

    <script>
        var mySwiper = new Swiper('.swiper-container', {
            // 垂直切换
            // direction: 'vertical',
            // 水平切换
            direction: 'horizontal',
            loop: true,
            // 自动切换时间
            autoplay : 2000,
            // 切换效果：fade、cube、coverflow、flip
            effect : 'fade',

            // 如果需要分页器
            pagination: '.swiper-pagination',

            // 如果需要前进后退按钮
            nextButton: '.swiper-button-next',
            prevButton: '.swiper-button-prev',

            // 如果需要滚动条
            scrollbar: '.swiper-scrollbar',
        })        
    </script>
</body>

</html>